package com.m1.tzolkin.model;

import com.m1.tzolkin.model.util.TurnsCounter;

public class TZCalendar extends TurnsCounter implements ITZCalendar, TzolkinConstants {
	
	// ATTRIBUTS
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7122342744093225131L;
	private int corn;
	
	// CONSTRUCTEUR
	
	public TZCalendar() {
		super(DAYS);
		corn = 0;
	}
	
	// REQUETES

	@Override
	public Season feedingDay() {
		for (Season s : Season.values()) {
			for (Integer i : s.getDates()) {
				if (getTurn() == i) {
					return s;
				}
			}
		}
		return null;
	}
	
	@Override
	public int getCorn() {
		return corn;
	}
	
	// COMMANDES
	
	@Override
	public void emptyCorn() {
		corn = 0;
	}
	
	@Override
	public void addCorn() {
		++corn;
	}

}
